Lecture: Abstracting with Functions
Slides
This deck of slides will be covered over three lectures.
Different lecture sections might be slower or faster in covering the material.
There's no need to read all of the slides at once. Pace yourself. Here's a suggestion:
- For the first lecture, read until the end of the LOCAL VARIABLES section.
- For the second lecture, read the slides in RETURN VS. PRINT and FUNCTIONS AND TURTLES (up to the slide titled Turtle Functions)
- For the third lecture, read the remaining slides.
Readings
- Think Python, Ch. 3: Functions
- Think Python, Ch. 6: Return Values (only sections 6.1, 6.2, and 6.4 for now)
Code
Click on this lec03_04_05_functions.zip link to download the .zip
file to your computer.
Solutions (for after class)
Use these sample solutions for review only after you have completed the code exercises. You will learn much more by trying them first and comparing your approach with the solutions.